package com.pxsw.mobile.hcd.act;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.widget.RadioGroup;

import com.mdx.mobile.activity.MActivityGroup;
import com.mdx.mobile.widget.AMLayout;
import com.mdx.mobile.widget.FillLine;
import com.pxsw.mobile.hcd.widget.CurrView;
import com.pxsw.mobile.hcd.R;

public class FrameAg extends MActivityGroup {
	private AMLayout layout;
	private RadioGroup mToolBar;
	private CurrView cv;

	@Override
	protected void create(Bundle arg0) {
		setContentView(R.layout.frame);
		mToolBar = (RadioGroup) findViewById(R.frame.toolbar);
		layout = (AMLayout) findViewById(R.frame.content);
		cv=(CurrView) findViewById(R.frame.cv);
		layout.setCurrentView(cv);
		this.setContentLayout(layout);
		{
			Intent intent = new Intent(this, IndexAct.class)
					.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
			this.addChild(R.frame.index, "index", intent);
		}
		{
			Intent intent = new Intent(this, AddItemAct.class)
					.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
			this.addChild(R.frame.additem, "additem", intent);
		}
		
		{
			Intent intent = new Intent(this, IndexAct.class)
					.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
			this.addChild(R.frame.order, "order", intent);
		}
		
		{
			Intent intent = new Intent(this, IndexAct.class)
					.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
			this.addChild(R.frame.more, "more", intent);
		}
		
		int nowCheckedRadioId=mToolBar.getCheckedRadioButtonId();
		if(nowCheckedRadioId!=-1){
		}
		mToolBar.setOnCheckedChangeListener(new FillLine.OnCheckedChangeListener() {
			public void onCheckedChanged(RadioGroup group, int checkedId) {
				setCurrent(checkedId);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.frame_ag, menu);
		return true;
	}
}
